﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;

public partial class Pages_Masters_Default : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        HttpCookie cookie = Request.Cookies["clienteLogged"];
        if (cookie == null)
        {
            Response.Redirect("loginError.aspx");
        }
        else
        {
            String rutCliente = cookie.Value.ToString();
            ClientesBLL clientebll = new ClientesBLL();
            DataSetCarpay.CLIENTEDataTable dt = clientebll.getCliente(rutCliente);
            lblRut.Text = dt.Rows[0][dt.RUT_CLIENTEColumn].ToString();
            string[] soloNombre = dt.Rows[0][dt.NOMBRE_CLIENTEColumn].ToString().Split(' ');
            lblNombreTitulo.Text = soloNombre[0];
            lblNombre.Text = dt.Rows[0][dt.NOMBRE_CLIENTEColumn].ToString();
            lblDireccion.Text = dt.Rows[0][dt.DIRECCION_CLIENTEColumn].ToString();
            lblEmail.Text = dt.Rows[0][dt.EMAIL_CLIENTEColumn].ToString();
            //if ((int)dt.Rows[0][dt.TIPO_CLIENTEColumn] == 0) lblTipo.Text = "Real";
            //else lblTipo.Text = "Potencial";

        }
    }
}
